package com.tentative.competition.web.controller.schedule;

import com.tentative.competition.common.core.domain.AjaxResult;
import com.tentative.competition.schedule.service.ScheduleFileInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @auther: Smile Huang
 * @date: 2023/6/22 22:16
 * @desc:
 * @version: 2.0
 */
@Api(tags = "附件管理")
@RestController
@RequestMapping("/file")
public class FileController {

    @Autowired
    private ScheduleFileInfoService fileInfoService;


    @ApiOperation("附件上传")
    @PostMapping("/fileUpload")
    public AjaxResult fileUpload(MultipartFile file){
        return AjaxResult.success(fileInfoService.fileUploads(file));
    }


}
